Hi Tapio,
I
think the idea is correct but the syntax is wrong. && is the
logical "and" operator in C.
Try:
// if all axes channels are enabled then enable the
amps
if (ch0->Enable &&
ch1->Enable && ch2->Enable)
SetBit(DrivePermit);
else
ClearBit(DrivePermit);
or alternate ways more along your thinking
might be:
(SetStateBit requires two parameters - which bit and the
state. It is not assignable)
SetStateBit(DrivePermit, ch0->Enable &&
ch1->Enable && ch2->Enable);
or this (not recommended but
may also work)
SetStateBit(DrivePermit, (ch0->Enable + ch1->Enable +
ch2->Enable)/3);
HTH
Regards
TK